package cn.itsource.controller.app;

import cn.dev33.satoken.annotation.SaIgnore;
import cn.itsource.pojo.vo.LoginInfoVo;
import cn.itsource.result.R;
import cn.itsource.service.ILoginService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotEmpty;


@Tag(name = "小程序登录表",description = "登录表")
@RestController
@RequestMapping("/app/login")
public class AppLoginController {

    @Autowired
    public ILoginService loginService;


    @Operation( summary= "微信注册",description = "微信注册接口")
    @PostMapping("/wechat/login/{openIdCode}")
    @SaIgnore //忽略拦截
    public R wechatLogin(@PathVariable("openIdCode") @NotEmpty(message = "参数不能为空") String openIdCode){
        LoginInfoVo loginInfoVo = loginService.wechatLogin(openIdCode);
        return R.success(loginInfoVo);
    }
}
